<!DOCTYPE html><html><head>
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <meta name="format-detection" content="telephone=no">
    <meta http-equiv="content-type" content="text/html;charset=utf-8">
	<title>消息</title>
	<link href="<?php echo TEMPLATE_SITE_URL;?>/css/message.css" type="text/css" rel="stylesheet">
	<script type="text/javascript" src="<?php echo RESOURCE_SITE_URL;?>/js/zepto.js" charset="utf-8"></script>
	<style>
	* {
		outline: none;
		-webkit-tap-highlight-color: rgba(255, 0, 0, 0);
		vertical-align: baseline;
		font-style: normal;
	}
	body {
		margin: 0;
		padding: 0;
		font-size: 12px;
		font-family: Microsoft Yahei, Arial, Simsun, Helvetica, Segoe UI, sans-serif;
		color: #404040;
		background-color: #EFEFF4;
	}
	img {
		border: 0
	}
	ul, ol, li, dt, dl, dd {
		text-decoration: none;
		list-style: none;
		vertical-align: middle;
		margin: 0;
		padding: 0;
	}
	a {
		color: #373737;
		text-decoration: none;
	}
	a:visited {
		color: #d83d37
	}
	.topMenu {
		width: 100%;
		height:50px;
	}
	.topMenu .buyAndSell {
		display: table;
		width: 160px;
		border: 1px solid #d83d37;
		border-radius: 4px;
		height: 28px;
		line-height: 28px;
		margin: 0 auto;
		margin-top: 10px;
		color: #d83d37;
	}
	.topMenu .buyAndSell .buy, .topMenu .buyAndSell .sell {
		float: left;
		width: 50%;
		text-align: center;
		font-size: 13px;
	}
	.topMenu .buyAndSell .now {
		background-color: #d83d37;
		color: #fff;
	}
	</style>
</head>
<body>
<div id="contentbox">
  <div class="topMenu">
    <div class="buyAndSell"> 
      <?php if(!empty($_GET['type'])){?>
      <a href="javascript:;" class="buy now">买买买</a>
      <a href="index.php?act=my&op=message"><div class="sell">卖卖卖</div></a>
      <?php }else{?>
      <a href="index.php?act=my&op=message&type=1" class="buy">买买买</a>
      <div class="sell now">卖卖卖</div>
      <?php }?>
    </div>
  </div>
</div>
<div id="contentbox">
			<?php if(!empty($output['auction'])){?>
			<?php foreach($output['auction'] as $auction){?>
            <div class="msgMain">
            		<!--  <div class="msgTime">2015年10月04日</div>	-->
        			<div class="msgItem seller">
				        <div class="saleContent" onclick="javascript:location.href='index.php?act=index&auction_id=<?php echo $auction['id'];?>';">
				            <div class="img" style="background-image: url(<?php echo UPLOAD_SITE_URL.'/shop/auction/'.$auction['auction_add_date'].'/'.$auction['auction_img1'];?>);"></div>
				            <div class="desc"><?php echo $auction['auction_description'];?></div>
				        </div>
	        			<div class="msgContent">
	            			<div class="msgBanner up" aid="<?php echo $auction['id'];?>">
	            				<div class="msgNums read" ><?php echo count($auction['seller_log'])?></div>
	            				<?php if(!empty($_GET['type'])){?>买家最新消息<?php }else{?>卖家最新消息<?php }?>	            				
	            			</div>
	            			<?php if(!empty($auction['seller_log'])){?>
	            			<div class="msgList">
	                    		<div class="msg">
	        						<div class="timeLogo"></div>
	        						<div class="msgDetail"><?php echo $auction['seller_log'][0]['message'];?></div>
	        						<div class="time"><?php echo date("Y-m-d",$auction['seller_log'][0]['add_time']);?></div>
	    						</div>
            				</div>
            				<?php }?>
            				
					        <div class="moreMsg" style="display: none;" said="<?php echo $auction['id'];?>">
					        	<?php if(!empty($auction['seller_log'])){?>
					        	<?php $i=0;?>
					        	<?php foreach($auction['seller_log'] as $log){?>
					        	<?php if($i>0){?>
					        	<div class="msg" >
						        	<div class="timeLogo"></div>
						        	<div class="msgDetail"><?php echo $log['message'];?></div>
						        	<div class="time"><?php echo date("Y-m-d",$log['add_time']);?></div>
					    		</div>
					    		<?php }?>
					    		<?php $i++;?>
					    		<?php }?>
					    		<?php }?>
					    	</div>
    					</div>
    			</div>
			</div>
			<?php }?>
			<?php }?>
</div>
<script type="text/javascript">
	$(function(){
		$('.msgBanner').click(function(){

			if($(this).hasClass('up')){
				var aid = $(this).attr('aid');
				$(this).removeClass('up');
				$(this).addClass('down');
				$("div[said='"+aid+"']").show();
			}else{
				var aid = $(this).attr('aid');
				$(this).removeClass('down');
				$(this).addClass('up');
				$("div[said='"+aid+"']").hide();
			}
			
			
		});		
	});

</script>
</body>
</html>